import sys
from PyQt6.QtWidgets import QApplication, QMainWindow, QWidget, QHBoxLayout, QSizePolicy
from PyQt6.QtGui import QGuiApplication
from left import LeftWidget
from middle import MiddleWidget
from right import RightWidget

class MainWindow(QMainWindow):
    def __init__(self):
        super().__init__()
        self.init_ui()
        self.set_desktop_size()


    def init_ui(self):
        self.setWindowTitle("")
        self.left = LeftWidget()
        self.middle = MiddleWidget()
        self.right = RightWidget()

        main_layout = QHBoxLayout()
        main_layout.addWidget(self.left,stretch=2)
        main_layout.addWidget(self.middle,stretch=5)
        main_layout.addWidget(self.right,stretch=2)
        main_layout.setContentsMargins(0,0,0,0)
        main_layout.setSpacing(10)

        central_widget = QWidget()
        central_widget.setLayout(main_layout)
        self.setCentralWidget(central_widget)
        central_widget.setSizePolicy(QSizePolicy.Policy.Expanding,QSizePolicy.Policy.Expanding)

    def set_desktop_size(self):
        screen = QGuiApplication.primaryScreen()
        if screen:
            desktop_geometry = screen.availableGeometry()
            self.move(desktop_geometry.topLeft())
            self.resize(desktop_geometry.size())


if __name__ == "__main__":
     app = QApplication(sys.argv)
     window = MainWindow()
     window.show()
     sys.exit(app.exec())

